<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property int $goods_id 
 * @property string $title 
 * @property int $is_sale 
 * @property int $sort 
 */
class GoodsProperty extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'goods_property';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'goods_id' => 'integer', 'is_sale' => 'boolean', 'sort' => 'integer'];

    public $hidden = ['goods_id', 'sort'];

    /**
     * 属性值关联
     *
     * @return mixed
     */
    public function value()
    {
        return $this->hasMany(GoodsPropertyValue::class, 'property_id');
    }
}